1. Field of the Invention
The present invention relates to a bit expander that is suitable for graphics data and that allows bits of digital data to be smoothly expanded.
2. Description of the Related Art
In computers and home-use video game apparatuses, so-called full-color graphic data has a data width of 24 bits where eight bits are assigned to each of R (red), G (Green), and B (Blue). Thus, since each of primary colors is represented with 256 tones, a total of around 16,770,000 colors can be represented.
However, actually, due to a restriction of a memory space or the like, graphics data is occasionally handled as data of 16 bits. For example, five bits, six bits, and five bits are assigned to R (Red), G (Green), and B (Blue), respectively. Graphics data of 16 bits is stored to for example a storage medium. Various picture processes are performed for graphics data read from a storage medium and the resultant data is displayed on a screen.
When graphics data of 16 bits is processed, there are situations of which the graphics data should be handled as data of 24 bits. For example, when the data width of an internal bus is eight bits, each of primary colors R, G, and B should be handled as data of eight bits. In another situation, three primary colors R, G, and B are processed as data of five bits, data of six bits, and data of five bits, respectively, and each of them are displayed as data of eight bits.
In such situations, the data width of each of the three primary colors R, G, and B should be expanded from five bits (or six bits) to eight bits. In a related art reference, a bit expansion is performed with fixed values. In other words, all "1s" or all "0s" are added to the low order side of original data. FIGS. 1A and 1B shows bit expansions with such fixed values. N "1s" (see FIG. 1A) or n "0s" (see FIG. 1B) are added to the low order side of data of m bits and thereby data of (m+n) bits is obtained. In this method, with a very simple circuit, bits can be expanded. In reality, expansion bits are placed below a decimal point.
FIG. 2 shows an example of the result of a bit expansion according to the related art reference. In FIG. 2, a value 255.255/256 on the vertical axis represents 255+(255/256). In this example, it is assumed that m=n =8 (bits). In the method shown in FIG. 1A, when n "1s" are used as expansion bits, as denoted by a line A shown in FIG. 2, an offset of 255/256 is added to the original value. On the other hand, in the method shown in FIG. 1B, the expanded result is the same as the original value (as denoted by a line B in FIG. 2).
Now, consider the case of which such a bit expansion is applied to graphics data. When graphics data is expanded as denoted by the line A and the resultant data is displayed, the black level is raised. Likewise, when graphics data is expanded as denoted by the line B and the resultant data is displayed, the maximum level of the white level is slightly lowered. Thus, the black level or white level deviates at both edges thereof or in the vicinity thereof. The user easily becomes aware of such deviations. In other words, ideally, a bit expansion should be performed smoothly in the full range as denoted by a line C in FIG. 2.
Thus, in the bit expanding method of the related art reference, data (in particular, graphics data) cannot be smoothly displayed in the full range.